package com.bgIntlgn.client.entity.manufacture.picLibrary;

import yuhuibear.poat.object.bean.Bean;

public class ToFetchFromTech implements Bean {

	//
	// @Macro(name = "waitToFetchFromTech", depend = "nodeHas")
	// public String createToFetchPicsFunction() {
	// String sql =
	// "create or replace function waitToFetchFromTech() returns bigint[] as $BODY$ declare planed_pic_id bigint[];"
	// + "declare picid bigint; declare cnt int = 0; begin"
	// + " for picid in ("
	// +
	// "select distinct pic.id from production_plans as pp, production_iterms as pi, pic_papers as pic	where "
	// + "(pp.state = "
	// + ProductionPlan.State.preparing.ordinal()
	// + " or pp.state = "
	// + ProductionPlan.State.producing.ordinal()
	// +
	// ") and pi.paper_prepared = false and pi.uid = pic.uid and pp.id =pi.plan_id) loop 	"
	// + "if nodeHas(picid,"
	// + PicPaperCirculateLibrary.Place.techToFactory.ordinal()
	// + " , "
	// // + PicPaperCirculateLibrary.Place.factoryToTech.ordinal()
	// + ") > 0 then planed_pic_id[cnt] = picid; end if; "
	// + "end loop; return planed_pic_id;"
	// + "end; $BODY$ language plpgsql;";
	// // System.out.println(sql);
	// return sql;
	// }
}
